home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 033a / prokit34.zip / MINICRT.INT < prev    next >
Text File  |  1991-04-01  |  2KB  |  82 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1991 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * MiniCrt - version of Borland's CRT unit that understands and interprets
  15.  * most ANSI codes.  When OVCRT environment variable exists, the unit
  16.  * does not do direct video, allowing operation under window managers
  17.  * and non-standard display environments.
  18.  *
  19.  *)
  20.  
  21. unit MiniCrt;
  22.  
  23. interface
  24.  
  25.    uses DOS, Crt;
  26.  
  27.    function KeyPressed: Boolean;
  28.    function ReadKey: Char;
  29.  
  30.    procedure Window(X1,Y1,X2,Y2: Byte);  {only partial support}
  31.    procedure SetScrollPoint(Y2: Byte);
  32.    procedure FullScreen;
  33.  
  34.    procedure GotoXY(X,Y: Integer);
  35.    procedure BiosGotoxy(x,y: byte);
  36.    procedure HideCursor;
  37.  
  38.    function WhereX: Byte;
  39.    function WhereY: Byte;
  40.  
  41.    procedure ClrScr;
  42.    procedure ClrEol;
  43.  
  44.    procedure NormalVideo;
  45.    procedure LowVideo;
  46.    procedure ReverseVideo;
  47.    procedure BlinkVideo;
  48.    procedure SaveColor;
  49.    procedure RestoreColor;
  50.  
  51.    procedure AnsiAttributes;
  52.    procedure InterpretAnsi(action: char);
  53.  
  54.    {$F+} function ConFlush(var F: TextRec): integer; {$F-}
  55.    {$F+} function ConOutput(var F: TextRec): integer; {$F-}
  56.    {$F+} function ConOpen(var F: TextRec): Integer; {$F-}
  57.  
  58.    const
  59.       scroll_line:   byte = 23;
  60.       directVideo:   boolean = true;
  61.       ansi_xtab:     array[0..7] of byte = (0,4,2,6,1,5,3,7);
  62.       ansi_savex:    byte = 1;
  63.       ansi_savey:    byte = 1;
  64.       ansi_pending:  boolean = false;
  65.       max_ansi_stack = 10;
  66.  
  67.       cursor_moved:  boolean = false;
  68.  
  69.    var
  70.       ansi_fg:       byte;
  71.       ansi_bg:       byte;
  72.       ansi_stack:    array[1..max_ansi_stack] of byte;
  73.       ansi_depth:    integer;
  74.       ansi_val:      byte;
  75.       ansi_digits:   boolean;
  76.       ansi_pcolor:   word;
  77.  
  78.       crtout:        text;  {output through CRT unit}
  79.       stdout:        text;  {output through dos for ANSI compatibility}
  80.  
  81. implementation
  82.